package com.oragraph.trials;

import org.python.util.PythonInterpreter;

import com.oragraph.data.Node;
import com.oragraph.data.instance.impl.BasicInstance;

public class Trial3Jython {

	public static void main(String args[]) {
		try {
			
			Node n=new BasicInstance("SID_1", "SID");
			
			PythonInterpreter interp = new PythonInterpreter();
			interp.set("node", n);
			int result=-1;
			interp.set("result", result);
			
			String toExec=
				"print result\n"+
				"if node.getImmutableProperties().get('type')=='SID': \n" +
				"	result=1\n"+
				"else:\n"+
				"	result=0\n";
			
			interp.exec(toExec);
			result=interp.get("result").asInt();
			
			System.out.println("Result="+result);
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
	
}
